<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> -->
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="app">{{message}}</div>
  <div id="app-2">
    <span v-bind:title="messs">
      鼠标悬浮几秒钟查看
    </span>
  </div>
  <div id="app-3">
    <p>{{message}}</p>
    <button v-on:click="reverseMessage">反转信息</button>
  </div>
  <div id="app-4">
    <h2>{{message}}</h2>
    <input v-model="message">
  </div>
  <script>
    var app = new Vue({
      el: '#app',
      data: { message: 'Hello Vue' },
    })
    var app2 = new Vue({
      el: '#app-2',
      data: {
        messs: '页面加载于 ' + new Date().toLocaleString()
      }
    })
    var app3 = new Vue({
      el: '#app-3',
      data: {
        message: '你好,Vue'
      },
      methods: {
        reverseMessage: function () {
          this.message = this.message.split('').reverse().join('');
        }
      }
    })
    // 双向绑定
    new Vue({
      el: '#app-4',
      data: {
        message: '你好'
      }
    })
  </script>
</body>

</html>